package org.grayrabbit.cms.component;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;


public class Crumbs extends AbstractComponent{

	@Override
	protected Map<String, String> loadparameterMap(String component, String[] ps) {
		Map<String, String> map = new HashMap<String, String>();
		for(int i = 0; i < ps.length; i=i+2) {
			String exp = "";
			if("catId".equalsIgnoreCase(ps[i])) {
				if(StringUtils.isNotBlank(ps[i+1]))
					exp = "catId='" + ps[i+1] + "'";
				map.put("catId", exp);
			}else if("type".equalsIgnoreCase(ps[i])) {
				if(StringUtils.isNotBlank(ps[i+1]))
					exp = "type='" + ps[i+1] + "'";
				map.put("type", exp);
			}
		}
		return map;
	}

}
